﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IceDog.DNL.CSharp.DesignPattern.ProxyPattern.ImageLibrary
{
    public class ProxyImage:IImageAction
    {
        private RealImage _realImage;
        private readonly string _fileName;
        
        public ProxyImage(string fileName)
        {
            _fileName = fileName;
        }
        public void Display()
        {
            if (_realImage == null)
            {
                _realImage = new RealImage(_fileName);
            }
            _realImage.Display();
        }
    }
}
